﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    enum NPCType
    {
        Task,
        Shop,
        Iron
    }
    abstract class npc
    {
        public string name { get; set; }
        public NPCType type{ get; set; }
        public npc(string name, NPCType type)
        {
            this.name = name;
            this.type = type;
        }
        public abstract void Speak();

    }

    class TaskNPC : npc
    {
        public string item  { get; set; }
        public override void Speak()
        {
            Console.WriteLine(this.name+":"+this.item);
            Console.WriteLine();
        }

        public TaskNPC(string name, NPCType type, string item) : base(name, type)
        {
            this.item = item;
        }
    }
    class ShopNPC: npc
    {
        public string item { get; set; }

        public override void Speak()
        {
            Console.WriteLine("{0}：我这有个宝贝{1}送给你",this.name,this.item);
            Console.WriteLine("恭喜获得{0}",item);
            Console.WriteLine();
        }
        public ShopNPC(string name, NPCType type, string item) : base(name, type)
        {
            this.item = item;
        }
    }

    class SmithyNPC : npc
    {
        public string item { get; set; }

        public override void Speak()
        {
            Console.WriteLine("{0}：你的小刀是否要{1}",this.name, this.item);
            Console.WriteLine();
            Console.WriteLine("Y/是，N/否");
            string a = Console.ReadLine();
        }
        public SmithyNPC(string name, NPCType type, string item) : base(name, type)
        {
            this.item = item;
        }
    }


}
